﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using MP.Core.Authentication;
using MP.Core.Library;
using MP.Core.Config;

using MP.LayerHelper.MP_OBS.BLL;

public partial class Admin_Controls_Menu : System.Web.UI.UserControl
{
    public string MenuId = "HUR|ACCOUNT";
    //MenuService smenu = (MenuService)WebUtility.GetWebService(EnumServices.CRM, "ManagerService/MenuService.asmx", typeof(MenuService), "DataLayer.MenuService");
    //MenuService smenu = new MenuService();
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadData();
    }

    void LoadData()
    {
        char[] ch = { '|' };
        string[] mnu = MenuId.Split(ch, StringSplitOptions.RemoveEmptyEntries);
        DataSet dst = MenuManager.CreateInstant().GetMenuParent(mnu);
        repMenu.DataSource = dst;
        repMenu.DataBind();
    }

    public DataTable getMenu(string menuId)
    {
        DataSet dst = MenuManager.CreateInstant().GetMenuByParentId(menuId);
        DataTable menu = MPRoleProvider.CreateInstant().CheckRolesMenu(Util.CurrentUserName, dst.Tables[0]);
        return menu;
    }
}
